package provider;

import history.BasicDataHistory;
import history.DataHistory;
import common.Data;

import parser.ParserImpl;
import source.DataSourceListener;
import source.RawData;

public class DataProvider implements DataSourceListener {
	
	private DataHistory dataHistory;
	
	public DataProvider() {
		dataHistory = new BasicDataHistory();
	}

	@Override
	public void notify(RawData data) {
		Data result = new ParserImpl().parse(data);
		dataHistory.add(result);
	}
	
	public DataHistory getDataHistory() {
		return dataHistory;
	}

}
